× Lesson 1 Lesson 2 Lesson 3 Lesson 4 Lesson 5 Lesson 6 Lesson 7 Lesson 8 Lesson 9 Lesson 10 Lesson 11 Lesson 12 Lesson 13 Lesson 14 Lesson 15 Lesson 16 Lesson 17 Lesson 18 Lesson 19 Lesson 20 Lesson 21 Lesson 22 Lesson 23 Lesson 24 Lesson 25 Mini Lesson 1 Mini Lesson 2 Mini Lesson 3 Mini Lesson 4 Mini Lesson 5

Lessons

Lesson 8 - String operators

String operators are made up of several functions, such as .format(), and the concept of functions will be covered much deeper later in the course, that can be used with or be used to modify a string. The first operator is the .upper() function, which when used at the end of a string will capitalize every single letter. The second operator is the .lower() function, which when placed at the end of a string will make every letter lower case. The third operator is the len() function, which when a string is placed in between the parenthesises, it will count the amount of letters in the string. len() can also be with a list to count the number of pieces of data in the list.

An example for each respectively:

print('Hello'.upper())

Which would output 'HELLO'.

print('Hello'.lower())

Which would output 'hello'.

print(len('hello'))

Which would output 5.

print(len([1, 2, 3]))

Which would output 3.

I challenge you to perform the following: Set your first name equal to a variable and your last name equal to a variable, find the length of both, and divide your first name length by your last name's length.